package me.hl.oom;

import com.google.common.collect.Lists;
import me.hl.reflect.Person;

import java.util.List;

/**
 * 记得修改-Xms20M -Xmx20M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=E:\
 * java -Xmx1024 -jar ha456.jar .....
 * author: planck
 * createTime: 2016/12/9.
 */
public class OutOfMemoryTest {
    public static void main(String[] args) throws Exception {
        List<Person> persons = Lists.newArrayList();
        for (int i = 0; i < 1000000; i++) {
            Person person = new Person("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc");
            persons.add(person);
        }

    }
}
